//
// Created by 11510 on 2024/6/7.
//
#include <iostream>
#include <string.h>
#include <vector>
using std::cout;
using std::endl;
using std::vector;

/**
 *
 */
void test0(){
    vector<int> vec1{1, 2, 3, 4, 5};
    vec1.push_back(8);
    vec1.push_back(9);
    vec1.push_back(10);

    vec1.clear();
//    vec1.shrink_to_fit();
    cout << vec1.empty() << endl;
    cout << vec1.size() << endl;
    cout << vec1.capacity() << endl;

}

void test3(){
    vector<int> vec1(18);
    cout << vec1.size() << endl;
    cout << vec1.capacity() << endl;

    /* 预期vector大概会存放多少元素，使用reserve开辟元素的空间，但是不存放元素*/
    vector<int> vec2;
    vec2.reserve(188);
    cout << vec2.size() << endl;
    cout << vec2.capacity() << endl;

}



int main(int argc, char *argv[]){
    test3();
    return 0;
}

